#pragma once

#include "..\headers\GameObject.h"
namespace ne{
class LuaGameObject : public GameObject, public luabind::wrap_base {
public:
	LuaGameObject(void) : m_remove(false) {}
	virtual ~LuaGameObject(){std::cout << "destroyed LUA object\n";}

	virtual void onStartup() {call<void>("onStartup");}
	virtual void onInit() {call<void>("onInit");}
	virtual void onUpdate() {call<void>("onUpdate");}
	virtual void onSimulation() {call<void>("onSimulation");}
	virtual void onRemove() {call<void>("onRemove");}
	virtual void beginContact(GameObject* gameObject){call<void>("beginContact",gameObject);}
	virtual void endContact(GameObject* gameObject){call<void>("endContact",gameObject);}

	static void default_onStartup(GameObject* go);
	static void default_onInit(GameObject* go);
	static void default_onUpdate(GameObject* go);
	static void default_onSimulation(GameObject* go);
	static void default_onRemove(GameObject* go);
	static void default_beginContact(GameObject* go, GameObject* co);
	static void default_endContact(GameObject* go, GameObject* co);

	void Remove(){
		this->onRemove();
		GameObject::Shut();
	}
	void SetRemove(bool value) {m_remove=value;}
	bool GetRemove() const {return m_remove;}
private:
	bool m_remove;
};
}